<!DOCTYPE html>
    <html>
    <head>
        <script src="https://gosspublic.alicdn.com/aliyun-oss-sdk-4.3.0.min.js"></script>
    </head>
    <body>
    <input type="file" id="file" />
    <script type="text/javascript">
        var client = new OSS.Wrapper({
            region: 'oss-cn-beijing',
            accessKeyId: '{{$Credentials['AccessKeyId']}}',
            accessKeySecret: '{{$Credentials['AccessKeySecret']}}',
            stsToken: '{{$Credentials['SecurityToken']}}',
            bucket: 'fbw',
            secure: true
        });
        document.getElementById('file').addEventListener('change', function (e) {
            var file = e.target.files[0];
            var storeAs = 'temp/'+file.name;
            console.log(file);
            console.log(storeAs);
            console.log(file.name + ' => ' + storeAs);
            client.multipartUpload(storeAs, file).then(function (result) {
                console.log(result);
            }).catch(function (err) {
                console.log(err);
            });
        });
    </script>
    </body>

</html>

